package zsrt.com.page.utils;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;

public class Utlis {
	
	private static final String url="jdbc:mysql://127.0.0.1:3306/zsrt";
	private static final String user="root"; 
	private static final String password="123456";
	
	
	public static Connection getConnection() throws Exception{
		Class.forName("com.mysql.jdbc.Driver");
		Connection conn=DriverManager.getConnection(url,user,password);
		return conn;
	}
	/**
	 * 
	 * @param conn
	 * @param ps
	 * @throws Exception
	 */
	public static void closeConnStsatement(Connection conn,PreparedStatement ps) throws Exception{
		if(ps!=null){
			ps.close();
		}
		if(conn!=null){
			conn.close();
		}
	}

}
